#include <iostream>
#include <atomic>
#include <thread>
#include <unistd.h>

int g_count = 0;

void add()
{
    int i = 10000;
    while(i)
    {
        g_count++;
        i--;
    }
    
}

int main()
{
    std::thread thread1(add);
    std::thread thread2(add);

    thread1.join();
    thread2.join();

    std::cout<<"count:"<<g_count<<std::endl;
}